//
//  main.m
//  blockDalegateDemo
//
//  Created by zhouxiaobo on 15/10/28.
//  Copyright © 2015年 mapath. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Professor.h"
#import "Student.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        Professor *pf = [[Professor alloc]init];
        Student *stu = [[Student alloc]init];
        stu.degree = @"XS";
        
        pf.stu = stu;
        
        //block回调的实现
        __block Student *tempStu = stu;
        stu.cd =  ^(NSString* degree){
            tempStu.degree = degree;
        };
        
        NSLog(@"%@",stu.degree);  //打印开始的学位
        
        [pf giveDegree:@"SS"];    //授予学位
        
        NSLog(@"%@",stu.degree);  //打印授予后的学位        
        
    }
    return 0;
}
